﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Web.Security;
using System.Runtime.InteropServices;

namespace iResume
{
    public partial class Confirmation1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            Session["confirmationcode"] = contxb.Text;
            string confirmcode = (string)(Session["confirmationcode"]);

            bool result = DBManager.jsconfirmcode(contxb.Text);
            bool result1 = DBManager.rconfirmcode(contxb.Text);
            bool result2 = DBManager.aconfirmcode(contxb.Text);

            if (result == true)
            {
                FormsAuthentication.RedirectFromLoginPage(contxb.Text, false);           
                Response.Redirect("Resetpassword.aspx");

            }
            else
            {
                Messagelbl2.Text = " wrong confirmation code!";
            }

            if (result1 == true)
            {
                FormsAuthentication.RedirectFromLoginPage(contxb.Text, false);
                Response.Redirect("Resetpassword.aspx");

            }
            else
            {
                Messagelbl2.Text = " wrong confirmation code!";
            }

            if (result2 == true)
            {
                FormsAuthentication.RedirectFromLoginPage(contxb.Text, false);
                Response.Redirect("Resetpassword.aspx");

            }
            else
            {
                Messagelbl2.Text = " wrong confirmation code!";
            }

            
        }
    }
}